#ifndef DFCALCULATOR
#define DFCALCULATOR

#include <QWidget>
#include <QDialog>
#include <qtcore/qthread.h>
#include <qtcore/QObject>
#include <qtcore/QMutex>
#include <QtCore/QSize>
// #include <QtCore/qtimer.h>
#include "GraphTools.h"
#include "FrameMaker.h"
#include "BaseConfigs.h"
#include "DF.h"
#include <Inventor/Qt/viewers/SoQtViewer.h>

namespace Ui {
class DFCalculator;
}

namespace DDAGui
{
class DFCalculator: public QWidget
{
Q_OBJECT
public:
    explicit DFCalculator(QWidget *parent = 0);
    ~DFCalculator();

public Q_SLOTS:
    void calcBtnPressed();
    void speedChanged(int speed);
    void setRealTime(int flag);

private Q_SLOTS:
    void radioButtonDisplacementClicked();
    void radioButtonStressClicked();

public:
    void setRootSceneNode(SoSeparator* root){_frameMaker->setRootSceneNode(root);}
    void setSoQtViewer(SoQtViewer* viewer){_soQtViewer = viewer;}
    //_soQtViewer->setAntialiasing(true,3);}
    void initPlay();

private:
    void initConnection();
    void calc();
    bool ifContinuePlay();

private:
    DF* _dfCalculator;
    DDAGui::FrameMaker* _frameMaker;
    int _playSpeed;
    //     SoSeparator* _rootScene;
    SoQtViewer* _soQtViewer;

    double _maxDisplacement;
    bool _ifRealTime;

    Ui::DFCalculator *ui;

};
}
#endif